class Base
    def initialize()
        @a = 1
    end

    attr_reader :a
end

class Derived < Base
end

num = 0
(0 ... 1000000).each do
    obj = Derived.new
    num += obj.a
end

puts num
